<?php $this->load->view('admin/adhead.html'); ?>

<?php $this->load->view('admin/adsider.html'); ?>

  <!-- Content Wrapper. Contains page content -->
  <div class="content-wrapper">

    <!-- Main content -->
    <section class="content">

      <div class="row">
        <div class="col-xs-12">
          <div class="box box-primary">
            <div class="box-header">
              <h3 class="box-title">回收站列表</h3>
            </div>
            <!-- /.box-header -->
            <div class="box-body table-responsive no-padding">
              <table class="table table-hover">
                <tbody><tr>
					<th style="text-align:center;">序号</th>
                  <th>标题</th>
                  <th>分类</th>
                  <th>时间</th>
                  <th>编辑</th>
				  <th>操作</th>
                </tr>
<?php $j=1; ?>
                <?php foreach($article as $item):  ?>
	<tr>
		<td align="center"><?php echo $j;$j++;?></td>
		<td><?=$item->title?></td>
		<td><?php foreach($cate as $i):?><?php if($i->id==$item->cate){echo $i->name;} ?><?php endforeach; ?></td>
		<td><?=$item->time?></td>
		<td><?=$item->uid?></td>
		<td><a href="<?php echo site_url('article/revert/').$item->id;?>" class="btn btn-info btn-xs">恢复</a> <a href="<?php echo site_url('article/delete/').$item->id;?>" class="delart btn btn-warning btn-xs" data-toggle="modal" data-target="#delart">彻底删除</a></td>
	</tr>
	<?php endforeach; ?>
     
              </tbody></table>
            </div>
            <!-- /.box-body -->

			<div class="box-footer clearfix">
				<ul class="pagination pagination-sm no-margin pull-left">
					共有  <?php echo isset($num)?$num:"";  ?> 条记录
				</ul>
              <ul class="pagination pagination-sm no-margin pull-right">

			<?php echo isset($pages)?$pages:""; ?>
              </ul>
            </div>

          </div>
          <!-- /.box -->
        </div>
      </div>

    </section>
    <!-- /.content -->
  </div>
  <!-- /.content-wrapper -->

<?php $this->load->view('admin/adfooter.html'); ?>

<!----删除文章------>
<div class="modal fade modal-warning" id="delart" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
	<form method="get" id="delartform" action="">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                <h4 class="modal-title" id="myModalLabel">提醒</h4>
            </div>
            <div class="modal-body">您确定要删除该文章？</div>
            <div class="modal-footer">
                <button type="button" class="btn btn-outline pull-left" data-dismiss="modal">取消</button>
                <button type="submit" class="btn btn-outline delid">确定删除</button>
            </div>
        </div><!-- /.modal-content -->
    </form></div><!-- /.modal -->
</div>
<script type="text/javascript">
<!--
//删除文章
$('.delart').on('click',function(e){
	var url = $(this).attr("href");
	$("#delartform").attr("action",url);
	$('#delart').modal('show');
	return false;
})
//-->
</script>